<template>
  <div>
    <!-- 联系人列表 -->
    <ul>
      <li v-for="(item, index) in list" :key="index">
        <span>{{item.name}}</span>
        <span>{{item.tel}}</span>
        <button>拨号</button>
        <button @click="edit(item)">编辑</button>
        <button @click="del(index)">删除</button>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ['list'],
  methods: {
    // 编辑联系人，显示弹窗
    edit(info) {
      this.$emit('edit', info)
    },
    // 删除
    del(index) {
      this.list.splice(index, 1);
    }
  },
}
</script>

<style>

</style>